package com.zoweunion.mechanic.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zoweunion.mechanic.entity.TSSsVehicleModelEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 车类型号
 *
 * @author xp
 * @email 17688825585@163.com
 * @date 2020-05-25 20:08:39
 */
@Component
public interface TSSsVehicleModelDao  extends BaseMapper<TSSsVehicleModelEntity>{

    List<TSSsVehicleModelEntity> queryPage(@Param("map") Map<String, Object> map);

    List<Map<String,Object>> selectCount1();

    List<Map<String,Object>> selectCount2(@Param("thingsId")String thingsId);

    List<Map<String, Object>> selectCount3(@Param("thingsId")String thingsId);

    List<Map<String, Object>> selectThingsId();

    Map<String, Object> selectAvg(@Param("thingsId") String thingsId,
                                  @Param("byDate") String byDate,
                                  @Param("date") Object sample_date);

    List<Map<String, Object>> selectRoo( @Param("byDate")String s, @Param("thingsId")String things_id,
                                         @Param("date")Date sample_date);

    void updateStatus( @Param("id")Long id);

    void insertValue(@Param("work_hour")double engineTotalHours,
                     @Param("fuel")double totalFuelAmount,
                     @Param("things_id") String thingsId,
                     @Param("sample_date") Date sampleDate,
                     @Param("type") Integer type);

    long selectCountSum(@Param("map")Map<String, Object> params);

    // 计算总工时，总油耗，每小时油耗
    Map<String, Object> selectAverage(@Param("map")Map<String, Object> params);

    Map<String, Object> selectAverageNew(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> selectCountList(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> modelPercent(@Param("map")Map<String, Object> params);

    //统计的是服务商情况下的故障
    List<Map<String, Object>> spnOrder(@Param("map")Map<String, Object> params);

    long selectDay(@Param("map")Map<String, Object> params);

    //进行总油耗和总工时的统计，如果是车主账号，就会传参oId，并且如果是车主选择车辆或者是具体车辆页面则会传参cId
    Map<String, Object> workFuel(@Param("map")Map<String, Object> params);

    List<String> selectPro(@Param("map")Map<String, Object> params);

    Map<String, Object> selectByPro(@Param("map")Map<String, Object> params);

    Map<String, Object> selectAverageAll(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> modelList(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> selectPoints(@Param("map")Map<String, Object> reqMap);

    List<Map<String, Object>> selectCar(@Param("map")Map<String, Object> reqMap);

    List<Long> selectThingsCount();

    long selectOnline(@Param("map")Map<String, Object> reqMap);

    //全国平均工时/油耗统计，新增字段：isAllDayAveData 是否需要全国的当日/当月的平均数据，如果不需要可以不传字段或者传字段为false
    Map<String, Object> allDayAveData(@Param("map")Map<String, Object> params);

    //统计的是车主情况下的故障
    List<Map<String, Object>> spnOrderByOwner(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> workFuelList(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> allDayAveDataList(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> onlineCurrentList(@Param("map")Map<String, Object> params, @Param("item")Map<String, Object> item);

    List<Map<String, Object>> provinceList(@Param("map")Map<String, Object> params);

    List<Double>  selectIdlingPercent(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> faultListNew(@Param("map")Map<String, Object> params);

    long faultListCount(@Param("map")Map<String, Object> params);

    Map<String, Object> selectFuelWorking(@Param("map")Map<String, Object> params, @Param("item")String item);

    List<Map<String, Object>> selectCarNew(@Param("map")Map<String, Object> reqMap);


    List<Map<String, Object>> mapListNew(@Param("map")Map<String, Object> params);

    Map<String, Object> mapInfoNew(@Param("map")Map<String, Object> params);

    List<Map<String, Object>> getCarOwnerListForCarOwnerRang(Map<String, Object> params);

    List<Map<String, Object>> getRangForCarOwner(Map<String, Object> params);

    List<Map<String, Object>> getCarListForCarOwnerRang(Map<String, Object> params);

    List<Map<String, Object>> getRangForCar(Map<String, Object> params);

    /**
     * 获取物联网设备的半年的月平均工时(6个月)
     * @param params
     * @return
     */
    Map<String, Object> query6mAvgDataForThings(Map<String, Object> params);

    List<Map<String, Object>> getCarOwnerListForCarWorkPerRang(Map<String, Object> params);

    List<Map<String, Object>> getRangForCarWorkPerRang(Map<String, Object> params);

    List<Map<String, Object>> getCarListForCarWorkPerRang(Map<String, Object> params);

    List<Map<String, Object>> getRangForCarOfCarWorkPer(Map<String, Object> params);

    List<Map<String, Object>> selectOwnerThingsOnlineCount(Map<String, Object> params);

    int selectOwnerThingsCount(Map<String, Object> params);

    List<Map<String, Object>> getAllThings(Map<String, Object> params);

    List<Map<String, Object>> getAllThingsNew(Map<String, Object> params);

    List<Map<String, Object>> selectUsernameList(Map<String, Object> params);

    List<Map<String, Object>> selectBdCarList(Map<String, Object> params);

    String getWorkHoursOfDay(Map<String, Object> params);

    String getWorkDayCount(Map<String, Object> params);

    String getTotalWorkDayCount(Map<String, Object> params);

    String getWorkHoursOfWeek(Map<String, Object> params);

    String getWorkHoursOfMonth(Map<String, Object> params);

    String getTotalHours(Map<String, Object> params);

    String getTotalHoursOf24H(Map<String, Object> params);

    String getFuelConsumptionOfDay(Map<String, Object> params);

    String getFuelConsumptionOfWeek(Map<String, Object> params);

    String getFuelConsumptionOfMonth(Map<String, Object> params);

    String getTotalFuelConsumption(Map<String, Object> params);

    String getFuelConsumptionAnalysisOfDay(Map<String, Object> params);

    String getFuelConsumptionAnalysisOfWeek(Map<String, Object> params);

    String getFuelConsumptionAnalysisOfMonth(Map<String, Object> params);

    void group_concat_max_len();

    String getFuelConsumptionAvg(Map<String, Object> params);

    String getFuelConsumptionSimilarAvg(Map<String, Object> params);

    String getFuelConsumptionSingleCar(Map<String, Object> params);

    List<Map<String, Object>> equipmentReportByDay(Map<String, Object> paramsMap);
}
